<%-- 
    Document   : test1
    Created on : Dec 28, 2010, 4:30:14 PM
    Author     : admin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<%
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", -1);
    String url = request.getParameter("url");
    String q = null;
    if (url == null) {
      url = "http://elookinto.com/elconverter/docs/Oscar.rtf";
      q = "oscar movement";
    }
    String ff = request.getParameter("f");
    if (ff == null) {
      ff = "";
    }
    if (q == null) {
      q = request.getParameter("q");
    }
    if (q == null) {
      q = "";
    }

%>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/JavaScript" src ="js/jquery-1.4.3.min.js" > </script>

    <script type="text/JavaScript" src ="/elconverter/jscon.js?url=<%= url%>&f=<%=ff%>&showID=showID2&q=<%=q%>" > </script>
    <script type="text/javascript">
    </script>

    <%-- auto compete --%>
    <link rel="stylesheet" href="css/jquery.ui.all.css">
    <script  type="text/JavaScript" src="js/jquery.ui.core.js"></script>
    <script  type="text/JavaScript" src= "js/jquery.ui.widget.js"></script>
    <script  type="text/JavaScript" src="js/jquery.ui.position.js"></script>
    <script  type="text/JavaScript" src="js/jquery.ui.autocomplete.js"></script>
    <script>
      /*var data = [ "http://localhost:9080/elconverter/Oscar.docx", "http://w"];
      jQuery.noConflict();
      jQuery(function($) {
        $("#urls" ).autocomplete(data, {matchContains:true, minChars:0})
      });*/
      kw = ['movement oscar', 'oscar oxford', 'snow', 'lunch breakfast'];
      function set() {

       var ac = 'http://elookinto.com/elconverter/activeX.jsp?url=';
       ac += $('#urls').val() + '&q='+ $('#keywords').val();
      // alert(ac);
      
       $('#showID2').attr("src", ac);
      }


    </script>

    <title> API Demo </title>
  </head>
  <body>
    <h1 align="center"> eLookinto Viewer <a href="api.jsp"> API </a>  Demo/Snapshots </h1>

    <% //out.println(url + ".." + ff); %>
    <br/>
    
    <form method="Get"   onSubmit="  set();
                                                      return false;" >
      <table align="center">
        <tr> <td> URL: </td> <TD>
            <input type="text" name="url" id="urls" value="<%=url%>" size="80"/> </TD>
        </tr>

        <tr> <td> Demo Urls </td>
          <td>
            <select name="demo_urls" id="demo_urls" 
              onchange=" document.getElementById('urls').value = this.value + $('#f').val(); document.getElementById('keywords').value = kw[this.selectedIndex] ">
              <option value="http://elookinto.com/elconverter/docs/Oscar.rtf"> http://www.elookinto.com/elconverter/docs/Oscar.rtf</option>
              <option value="http://elookinto.com/elconverter/docs/Oscar.docx"> http://www.elookinto.com/elconverter/docs/Oscar.docx</option>
              <option value="http://elookinto.com/elconverter/docs/snow.doc"> http://www.elookinto.com/elconverter/docs/snow.doc</option>
              <option value="http://elookinto.com/elconverter/docs/sitelist.rtf"> http://www.elookinto.com/elconverter/docs/sitelist.rtf</option>
              <option value="http://www.drcnh.org/LegalServicePrograms.doc"> http://www.drcnh.org/LegalServicePrograms.doc</option>

            </select>
          </td></tr>
        <tr> <td> Highlighted Words: </td> <TD>
            <input id="keywords" type="text" name="q" value="<%= q%>" size="80"/> </TD>
        </tr>
        <tr>  <td> Format: </td> <TD>
            <Select name="f" id="f" onchange=" document.getElementById('urls').value = $('#demo_urls').val() + $('#f').val(); document.getElementById('keywords').value = kw[this.selectedIndex] ">  
              <option value="" > native format </option>
              <option value="$swf" >swf formart </option>
              <!--
              <option value="pdf" > pdf </option> -->
            </Select>
        </tr>

        <tr> <td colspan="2" align="center"> <input type="submit" value="Submit" 
                                                    /> </td></tr>
      </table>
    </form>
    <br/> <br/>
    <div align="center">
      <iframe align="center" width="1200" height="1600" id="showID2" style="border-width: 0;text-align: center">

      </iframe>

      <script type="text/javascript"><!--
        google_ad_client = "pub-1830488441040930";
        /* 160x600, created 1/6/11 */
        google_ad_slot = "6819310625";
        google_ad_width = 160;
        google_ad_height = 600;
        //-->
      </script>
      <script type="text/javascript"
              src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script>

    </div>
  </body>
</html>
